class Aircraft:
    def __init__(self):
        self.passengers = []  # 用于存储乘客列表

    def add_passenger(self, first_name, last_name, seat_number, ticket_type):
        """
        用于向飞机添加乘客的方法

        参数:
        first_name (str): 乘客的名字
        last_name (str): 乘客的姓氏
        seat_number (int): 乘客的座位号
        ticket_type (str): 乘客的票类型
        """
        passenger = Passenger(first_name, last_name, seat_number, ticket_type)
        self.passengers.append(passenger)
        return True

    def __str__(self):
        """
        返回飞机上所有乘客的描述字符串

        返回:
        str: 飞机上所有乘客的描述字符串
        """
        passenger_info = ""
        for passenger in self.passengers:
            passenger_info += str(passenger) + "\n"
        return passenger_info


class Passenger:
    """
    这是一个表示乘客的类
    """
    def __init__(self, first_name, last_name, seat_number, ticket_type):
        """
        构造函数，用于初始化乘客对象，删除名字中的前导和尾随空格

        参数:
        first_name (str): 乘客的名字
        last_name (str): 乘客的姓氏
        seat_number (int): 乘客的座位号
        ticket_type (str): 乘客的票类型
        """
        self.first_name = first_name.strip()
        self.last_name = last_name.strip()
        self.seat_number = seat_number
        self.ticket_type = ticket_type

    def __str__(self):
        """
        返回乘客的描述字符串

        返回:
        str: 乘客的描述字符串
        """
        return f"乘客姓名: {self.first_name.title()} {self.last_name.title()}, 座位号: {self.seat_number}, 票类型: {self.ticket_type}"

air_craft = Aircraft()
air_craft.add_passenger("san","zhang","1","a")
air_craft.add_passenger("si","li","2","a")
print(air_craft)

